package com.nexus.all.controller;

import com.nexus.bean.result.Result;
import com.nexus.mail.dto.SendEmailApiDTO;
import com.nexus.mail.service.IMailService;
import com.nexus.web.controller.CommonController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RequestMapping("mail")
@RestController
@AllArgsConstructor
@Api(tags = "邮件管理接口")
public class MailController extends CommonController {

    private final IMailService mailService;

    @ApiOperation(value = "发送邮件", notes = "发送邮件")
    @PostMapping("send")
    public Result<Boolean> send(@RequestBody SendEmailApiDTO dto) {
        return Result.newSuccess(mailService.sendCommonMail(dto));
    }
}
